Functional Interfaces vs. Function Types in Java with Lambdas
نویسنده
چکیده
In several steps the Java type system is extended by features, which we know from functional programming languages. In Java 5.0 [GJSB05] generic types as well as a limited form of existential types (bounded wildcards) are introduced. In Java 8 the language will be expanded by lambda expressions, functional interfaces as target types, method and constructor references and default methods. In an earlier approach real function types were introduced as types of lambdas. The function types have been replaced by functional interfaces (interfaces with one method).
منابع مشابه
Clash of the Lambdas Through the Lens of Streaming APIs
The introduction of lambdas in Java 8 completes the slate of statically-typed, mainstream languages with both object-oriented and functional features. The main motivation for lambdas in Java has been to facilitate stream-based declarative APIs, and, therefore, easier parallelism. In this paper, we evaluate the performance impact of lambda abstraction employed in stream processing, for a variety...
متن کاملStructural Type Inference in Java-like Languages
In the past we considered type inference for Java with generics and lambdas. Our type inference algorithm determines nominal types in subjection to a given environment. This is a hard restriction as separate compilation of Java classes without relying on type informations of other classes is impossible. In this paper we present a type inference algorithm for a Java-like language, that infers st...
متن کاملClash of the Lambdas
The introduction of lambdas in Java 8 completes the slate of statically-typed, mainstream languages with both object-oriented and functional features. The main motivation for lambdas in Java has been to facilitate stream-based declarative APIs, and, therefore, easier parallelism. In this paper, we evaluate the performance impact of lambda abstraction employed in stream processing, for a variety...
متن کاملJava & Lambda: a Featherweight Story
We present FJ&λ, a new core calculus that extends Featherweight Java (FJ) with interfaces, supporting multiple inheritance, λ-expressions, and intersection types. Our main goal is to formalise how lambdas and intersection types are grafted on Java 8, by studying their properties in a formal setting. We show how intersection types play a significant role in several cases, in particular in the ty...
متن کاملType Variability and Completeness of Interfaces in Java Applications
Interfaces are widely used as central design elements of Java applications. Although interfaces are abstract types similar to abstract classes, the usage of interfaces in Java applications may considerably differ from the usage of abstract classes. Unlike abstract classes, interfaces are meant to enable multiple inheritance in Java programs. Hence, interfaces are meant to encode shared similari...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2014